<%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>

<%@ Page Language="c#" CodeBehind="editRss.aspx.cs" AutoEventWireup="false" Inherits="umbracoRss.plugins.rss.editRss" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>EDIT RSS</title>
    <link href="<%=umbraco.GlobalSettings.Path%>/css/umbracoGui.css" type="text/css"
        rel="stylesheet" />

    <script type="text/javascript" src="<%=umbraco.GlobalSettings.Path%>/js/editorBarFunctions.js"></script>

    <script type="text/javascript" src="<%=umbraco.GlobalSettings.Path%>/js/xmlextras.js"></script>

    <script type="text/javascript" src="<%=umbraco.GlobalSettings.Path%>/js/xmlRequest.js"></script>

    <script type="text/javascript">
        function updateContentId() {
            var treePicker = window.showModalDialog('<%=umbraco.GlobalSettings.Path%>/dialogs/treePicker.aspx?appAlias=content', 'treePicker', 'dialogWidth=350px;dialogHeight=300px;scrollbars=no;center=yes;border=thin;help=no;status=no')
            if (treePicker != undefined) {
                document.getElementById("startNode").value = treePicker;
                if (treePicker > 0) {
                    umbracoStartXmlRequest('<%=umbraco.GlobalSettings.Path%>/webservices/aspx_ajax_calls/GetNodeName.aspx?NodeId=' + treePicker + '&ContextID=<%=umbraco.BasePages.BasePage.umbracoUserContextID%>', '', 'test_updateContentTitle()');
                } else
                    document.getElementById("documentNodeTitle").innerHTML = '<strong><%=umbraco.ui.Text("content", base.getUser())%></strong>';
            }
        }
        function test_updateContentTitle() {
            document.getElementById("documentNodeTitle").innerHTML = "<strong>" + umbracoXmlRequestResultTxt() + "</strong><br/>";
        }
    </script>

</head>
<body onload="resizePanel('Panel1',true);" onresize="resizePanel('Panel1',true);"
    bgcolor="#f2f2e9">
    <form id="Form1" method="post" runat="server">
    <cc1:UmbracoPanel ID="Panel1" runat="server" Width="608px" Height="336px" hasMenu="true"
        Style="text-align: center" Text="Edit RSS Feed">
        <h3 style="text-align: left;">
            Basic Information</h3>
        <cc2:Pane ID="Pane7" Style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px;
            padding-top: 10px; text-align: left" runat="server" Height="44px" Width="528px">
            <table width="100%">
                <tr>
                    <th width="170">
                        <%=umbraco.ui.Text("name", base.getUser())%>
                    </th>
                    <td>
                        <asp:TextBox ID="NameTxt" Width="300px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        Url
                    </th>
                    <td>
                        http://<%=Request.ServerVariables["SERVER_NAME"]%><%=umbraco.GlobalSettings.StorageDirectory%>/rss/
                        <asp:TextBox ID="UrlTxt" Width="150px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        TTL (Time to live)
                    </th>
                    <td>
                        <asp:TextBox ID="TtlTxt" Width="100px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        Category
                    </th>
                    <td>
                        <asp:TextBox ID="CategoryTxt" Width="300px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        Author
                    </th>
                    <td>
                        <asp:TextBox ID="AuthorTxt" Width="300px" runat="server"></asp:TextBox>
                        if empty, the umbraco user that have created the will be used.
                    </td>
                </tr>
                <tr>
                    <th>
                        Copyright Notice
                    </th>
                    <td>
                        <asp:TextBox ID="CopyrightTxt" Width="300px" runat="server" TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </cc2:Pane>
        <h3 style="text-align: left;">
            Source</h3>
        <cc2:Pane ID="Pane1" Style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px;
            padding-top: 10px; text-align: left" runat="server" Height="44px" Width="528px">
            <table width="100%">
                <tr>
                    <th width="170">
                        Get items from
                    </th>
                    <td>
                        <input id="startNode" type="hidden" value="-1" runat="server" /><span id="documentNodeTitle">
                            <asp:Literal ID="documentTitle" runat="server"></asp:Literal></span><a href="javascript:updateContentId()">Choose...</a>
                        <asp:RadioButtonList ID="fullPath" runat="server">
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <th>
                        Get description from
                    </th>
                    <td>
                        <asp:DropDownList ID="descriptionDdl" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th>
                        Get rss item created date from
                    </th>
                    <td>
                        <asp:DropDownList ID="pubdatefieldDdl" runat="server">
                        </asp:DropDownList>
                        if empty, the page update date will be used.
                    </td>
                </tr>
            </table>
        </cc2:Pane>
        <h3 style="text-align: left;">
            Filters</h3>
        <cc2:Pane ID="Pane2" Style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px;
            padding-top: 10px; text-align: left" runat="server" Height="44px" Width="528px">
            <table width="100%">
                <tr>
                    <th width="170">
                        Filter by Documenttype
                    </th>
                    <td>
                        <asp:DropDownList ID="filterDocumentTypeDdl" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th>
                        Filter by Property value
                    </th>
                    <td>
                        <asp:DropDownList ID="filterPropertyTypeDdl" runat="server">
                        </asp:DropDownList>
                        =
                        <asp:TextBox ID="filterValue" runat="server"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </cc2:Pane>
    </cc1:UmbracoPanel>
    </form>
</body>
</html>
